<include file="public@header"/>
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>

</head>
<body>
<div class="wrap js-check-wrap">

    <form  method="post" class="form-horizontal js-ajax-form margin-top-20">
        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">

                    <input type="hidden" value="{$id}" id="uids">
                    <tr>
                        <th class="col-md-2">用户ID<span class="form-required">*</span></th>
                        <td>
                            <input class="form-control" type="text"   name="uid" id="uid"/>
                        </td>
                    </tr>


                    <tr id="scorebox">
                        <th class="col-md-2">兑换数量<span class="form-required">*</span></th>
                        <td>
                            <input class="form-control" type="text"  name="number" id="number" />
                        </td>
                    </tr>


                </table>

                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="button" class="btn btn-primary js-ajax-submit" id="submits">提交</button>
                    </div>
                </div>
            </div>

        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">

    //提交信息

    $("#submits").click(function (){

        var tid=$("#uids").val();
        var uid = $("#uid").val();
        var number=$("#number").val();

        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引

        $.ajax({
            url:'duihuan',
            data:{tid:tid,number:number,uid:uid},
            type:'post',
            dataType:'json',
            success:function (ret){
                layer.msg(ret.msg)
                var logid=ret.data.logid;
                console.log(ret);
                if (ret.code==1){



                    layer.open({
                        type: 2,
                        area: ['500px', '400px'],
                        content: '/user/admin_index/printc?id='+logid,
                        success:function (){

                        },end:function (){
                            parent.layer.close(index); //再执行关闭
                        }

                    });
                }else{
                    layer.msg(ret.msg)
                }


            }

        })


    })



</script>
</body>
</html>
